import matplotlib.pyplot as plt
plt.bar([0, 1, 2, 3, 4], [-2, 3, 4, 5, 6], width=0.5, color='red', label="xx")
plt.bar([0, 1, 2, 3, 4], [1, 2, 3, 4, 5], width=0.5, color='blue', label='yy')
plt.xlabel('X轴标签')
plt.ylabel('Y轴标签')
plt.title('柱状图示例')
plt.legend()
plt.show()